package com.powernode.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.powernode.domain.Customer;
import com.powernode.mapper.CustomerMapper;
import com.powernode.model.BaseQuery;
import com.powernode.service.CustomerService;
import com.powernode.vo.CustomerVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CustomerServiceImpl implements CustomerService {
    @Autowired
    private CustomerMapper customerMapper;
    @Override
    public PageInfo<CustomerVo> queryCustomerListPage(Integer current, Integer size) {
        PageHelper.startPage(current,size);
        List<CustomerVo> list = customerMapper.selectList(new BaseQuery());
        return new PageInfo<>(list);
    }

    @Override
    public List<Customer> queryAllCustomerList() {
        return customerMapper.selectAllCustomerList();
    }
}
